<!DOCTYPE html>
<html>
{% include 'head.html' %}
<body>
	{% include 'navbar.html' %}
	{% if genre %}
		{% include 'header.html' %}
		{% url movies.views.view_genre description=genre.Description as genre_url %}
		{% if request.session.admin %}
			<ul class="nav nav-tabs">
				<li class="active">
					<a href="{{genre_url}}">View</a>
				</li>
				<li><a href="{{genre_url}}?edit=1">Edit</a></li>
			</ul>
		{% endif %}
		<table class="table table-striped table-bordered">
		<tr><th class="span5">#{{page.start_index}}{% if not page.start_index == page.end_index %}-{{page.end_index}}{%endif%} (of {{page.paginator.count}}) titles</th><th class="span1"></th><th class="span2"></th></tr>
			{% for movie, bool in movies %}
				<tr>
					{% url movies.views.view_movie urltitle=movie.UrlTitle as movie_url %}
					<td><a href="{{movie_url}}">{{movie.Title}}</a></td>
					<td style="text-align: center">{{movie.Year}}</td>
					<td style="text-align: center">
						{% if bool %}
							<a class="btn btn-small btn-success" href="{{movie_url}}">Options</a>
						{% else %}
							<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1&seen=1">Seen</a>
							&nbsp&nbsp&nbsp
							<a class="btn btn-small btn-success" href="{{movie_url}}?assoc=1&add=1">Want</a>
						{% endif %}
					</td>
				</tr>
			{% endfor %}
		</table>
		<div class="pagination">
			<ul>
				<li {% if not page.has_previous %} class="disabled" {% endif %}}><a href="{{genre_url}}?page={{page.previous_page_number}}&length={{page.paginator.per_page}}">&lt;&lt;</a></li>
				<li class="active"><a href="{{genre_url}}?page={{page.number}}&length={{page.paginator.per_page}}">{{page.number}}</a></li>
				<li{% if not page.has_next %} class="disabled" {% endif %}}><a href="{{genre_url}}?page={{page.next_page_number}}&length={{page.paginator.per_page}}">&gt;&gt;</a></li>
			</ul>
		</div>
		<div class="row">
			<div class="span4">
				<a href="{{genre_url}}?suggestion=1">Suggestion/Comment/Correction</a>
			</div>
		</div>
	{% else %}
		<div class="page-header">
			<h1>invalid genre</h1>
		</div>
	{% endif %}
	{% include 'footer.html' %}
</body>
</html>